load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "k8s",
    srcs = [
        "k8s.go",
        "net.go",
        "notify.go",
    ],
    importpath = "go.f110.dev/heimdallr/pkg/k8s",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/poll",
        "//vendor/github.com/fsnotify/fsnotify",
        "//vendor/golang.org/x/xerrors",
        "//vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1:apiextensions",
        "//vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1:apiextensions",
        "//vendor/k8s.io/apimachinery/pkg/api/errors",
        "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta",
        "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
        "//vendor/k8s.io/apimachinery/pkg/runtime",
        "//vendor/k8s.io/apimachinery/pkg/runtime/serializer",
        "//vendor/k8s.io/apimachinery/pkg/types",
        "//vendor/k8s.io/apimachinery/pkg/util/yaml",
        "//vendor/k8s.io/client-go/discovery",
        "//vendor/k8s.io/client-go/kubernetes",
        "//vendor/k8s.io/client-go/kubernetes/scheme",
        "//vendor/k8s.io/client-go/rest",
    ],
)

go_test(
    name = "k8s_test",
    srcs = [
        "k8s_test.go",
        "net_test.go",
        "notify_test.go",
    ],
    embed = [":k8s"],
    deps = [
        "//vendor/github.com/fsnotify/fsnotify",
        "//vendor/github.com/stretchr/testify/assert",
        "//vendor/github.com/stretchr/testify/require",
        "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
        "//vendor/k8s.io/apimachinery/pkg/runtime",
        "//vendor/k8s.io/apimachinery/pkg/util/yaml",
    ],
)
